#ifndef USER_H
#define USER_H

#include <QWidget>
#include "chatclient.h"
#include "database.h"
#include "modifyusermessage.h"
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QRegularExpressionMatch>

namespace Ui {
class user;
}

class user : public QWidget
{
    Q_OBJECT

public:
    explicit user(QString userID,QWidget *parent = nullptr);
    explicit user(QString fileName,QString userID,QWidget *parent = nullptr);
    ~user();

    void setConfig();
    void setConfig(QString fileName);

public slots:

    //接收发送消息的信号
    void receiveMessage(QString message);


private slots:
    void on_sendButton_clicked();


    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_query_clicked();

    void on_index_clicked();

private:
    Ui::user *ui;

    QString userName;

    QString userID;

    bool flag;

    chatClient *client;
    dataBase *db;
    //ca证书路径
    QString caCertificateFilePath;
    //客户端证书路径
    QString clientCertificateFilePath;
    //私钥路径
    QString clientKeyPath;
};

#endif // USER_H
